package com.exthirteen.textgamescript.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.exthirteen.textgamescript.entity.LicenseKey;
import com.exthirteen.textgamescript.mapper.LicenseKeyMapper;
import com.exthirteen.textgamescript.service.LicenseKeyService;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 设备服务
 * </p>
 *
 * @author exthirteen
 * @since 2025/5/5
 */
@Service
public class LicenseKeyServiceImpl extends ServiceImpl<LicenseKeyMapper, LicenseKey> implements LicenseKeyService {
    @Override
    public List<LicenseKey> getUnExpiredLicenseKey() {
        return list(new LambdaUpdateWrapper<LicenseKey>()
                .ne(LicenseKey::getWxId,"")
                .isNotNull(LicenseKey::getWxId)
                .gt(LicenseKey::getExpiryDate,LocalDate.now()));
    }
}
